from math import*
a = int(input('Введите число'))
if a<10000 and a>999:
    c=[]
    a1=a//1000
    a2=a//100
    a3=a//10
    a4=a%10%100%1000
    a5=a%100//10
    a6=a//100%10
    a7= a%10//100
    a8=a//1000%10
    a9=a%100%1000
    b = [a,a1,a2,a3,a4,a5,a6,a7,a8,a9]
for i in b:
    prime=True
    m=2
    while m<=sqrt(i):
        if i%m==0:
            prime=False
            break
        m+=1
        if prime:
            b.append(i)
    print(b)
